FIG. 5 is a schematic diagram of motor control device 501 that performs a position control of motor 7. Motor control device 501 includes movement command generator 1 that generates a movement command for driving and rotating motor 7, position controller 2 that controls an angular position of rotation of motor 7, speed controller 3 that controls a rotation speed of motor 7, current controller 4 that controls a current supplied to motor 7, amplifier 5 that supplies the current to motor 7, position detector 8 that detects the angular position of the rotation of motor 7, processor 10 that performs processing of a signal from position detector 8, and power supply 9 that supplies power to amplifier 5. Processor 10 processes the signal from position detector 8 of motor 7, and converts the result into actual speed co of motor 7 and actual movement amount Δθ of motor 7.
Movement command generator 1 generates movement command Δθ* based on an operation program produced by a user, and outputs the generated movement command for each predetermined period. Movement command Δθ* is a rotation amount of the motor per unit time.
Position controller 2 obtains position command Dθ by integrating movement commands Δθ* output from movement command generator 1 for each of predetermined periods, and subtracts actual movement amount Δθ for each of the predetermined periods from position command Dθ. Actual movement amount Δθ is a rotation angle amount of motor 7 for each predetermined time and is obtained by processing output of position detector 8 by processor 10.
Position controller 2 holds a position deviation amount which is a difference between the sum of movement commands Δθ* from movement command generator 1 and the sum of actual movement amounts Δθ from processor 10. Position controller 2 outputs speed command ω* which is the product obtained by multiplying the position deviation amount by a proportional constant (position gain). A value obtained by multiplying movement command Δθ* by a proportional constant (feedforward gain) may be added to the speed command.
Speed controller 3 performs, for example, a PI control on a difference between speed command ω* output from position controller 2 and actual speed ω of the motor output from processor 10, and outputs current command I*.
Current controller 4 performs, for example, a PI control on a difference between current command I* output from speed controller 3 and actual current I supplied to motor 7, and outputs a voltage command or a PWM command.
Actual current I is detected by current detector 6.
Amplifier 5 generates a current to be supplied to motor 7 from power supply 9 based on the voltage command or the PWM command from current controller 4.
Power supply 9 connected to amplifier 5 supplies electric power to amplifier 5, and serves as a current supply source of motor 7.
An industrial machine, such as a robot, is configured by using motor control device 501.
For example, a robot includes motors. The number of the motors is determined according to the number of joints of arms to be driven. Each motor is connected to the robot arm via a speed reduction gear.
The robot with the above configuration constitutes a dual inertial system in which the speed reduction gear and the arm are made of elastic material and the motor and a load (arm or the like) move via a rigid shaft (speed reduction gear or the like). In the dual inertial system, a vibration may occur during driving. In particular, the vibration is likely to occur when a movement starts from a stationary state and when the movement is stopped at a target position.
In general, movement command generator 1 of motor control device 501 performs so-called acceleration/deceleration processing such that movement command Δθ* gradually increases and thus reaches a target movement command amount after an elapse of a certain time, and that movement command Δθ* gradually decreases and thus becomes 0 at the target position as the arm of the robot (hereinafter, referred to as a robot arm) approaches the target position. Thereby, occurrence of the vibration is suppressed.
However, in spite of the acceleration/deceleration processing, a vibration may still occur.
In such a case, a filter is inserted between movement command generator 1 and position controller 2. The filter removes an excitation component included in the movement command.
The excitation component is a vibration component including a natural vibration of the dual inertial system. A cutoff frequency of the filter is set to a natural vibration frequency in the dual inertial system.
On the other hand, when a posture of the robot arm changes, the natural vibration frequency changes. This is because, viewing from the motor, the amount of the inertia of the robot arm and an object mounted on an end of the robot arm changes according to the posture of the robot.
Therefore, in a case of removing the excitation component by the filter, the cutoff frequency of the filter is changed according to the posture of the robot arm.
For this reason, a method for changing a filter coefficient of filter processing of a movement command according to the posture of the robot arm is proposed (PTL 1).
In general, when the filter coefficient is changed while data remains in the filter, the sum of inputs into the filter is not equal to the sum of outputs from the filter.
In the filter processing of the movement command, a problem may occur due to such a situation. This is because a target position after the filter processing (integrated value of the movement command after the filter processing) is different from an original target position (integrated value of the movement command before the filter processing).
Thus, as described below, a filter disclosed in PTL 1 is configured such that the target position is not different from the original target position even while the filter coefficient is changed from a movement start position to a target position.
In other words, n-number of filters are disposed in parallel, movement commands input for each control period are sequentially input to different filters, and the sum of outputs of the filters is used as a movement command which is input to the position controller.
This filter is a digital filter, an n-order finite impulse response (FIR) filter. In the n-order FIR filter (hereinafter, referred to as a filter), after one piece of data is input, when the next data is not input, the filter becomes empty after n-number of periods. In addition, after n-number of periods, when the filter becomes empty, the sum of inputs into the filter is equal to the sum of outputs from the filter.
In the filter, one movement command is processed by one filter, and then until the movement command is completely removed from the filter, the next movement command is not input into the filter. The next movement command is input into another filter connected in parallel.
Only when the filter becomes empty, the filter can receive a new movement command. For example, for N-number of movement commands, the first movement command is input into the first filter. Then, the second movement command is input into the second filter. The filler coefficient of the second filter may be different from the filter coefficient of the first filter.
In this manner, the k-th movement command (k≤n≤N) is input into the k-th filter, and such processes are sequentially performed in order. The filter coefficients are different a little from each other.
In this manner, when the n-th movement command is input into the n-th filter, since the first filter is empty, the (n+1)-th movement command is input into the first filter. The filter coefficient of the first filter at this moment can be set to a value different from the filter coefficient when the first movement command at the previous time is input.
This is repeated in order, and thus the filter constant is gradually changed.
In each filter, since the filter coefficient is not changed while the filter holds data (movement command), the sum of inputs is equal to the sum of outputs.
The configuration can change the cutoff frequency of the filter while moving, without occurrence of a difference between the sum of inputs of the movement command and the sum of outputs of the movement command.